import 'package:flutter/material.dart';
import 'package:untitled/pages/CheckBox/checkboxDemo.dart';
import 'package:untitled/pages/CupertinoActionSheetDemo.dart';
import 'package:untitled/pages/FlutterUI/Shopping/shopping.dart';
import 'package:untitled/pages/FlutterUI/Travel/travle_home.dart';
import 'package:untitled/pages/FlutterUI/Yiqing/yiqing.dart';
import 'package:untitled/pages/FlutterUI/shoe/shoe_main.dart';
import 'package:untitled/pages/FormView/form_widget.dart';
import 'package:untitled/pages/GestureDetector/GestureDetectorDemo.dart';
import 'package:untitled/pages/Getx_project/CountMainPage.dart';
import 'package:untitled/pages/Getx_project/CountObsMainPage.dart';
import 'package:untitled/pages/Getx_project/ShopMainPage.dart';
import 'package:untitled/pages/Getx_project/TestA.dart';
import 'package:untitled/pages/Getx_project/WorkesMainPage.dart';
import 'package:untitled/pages/Getx_project/getxDemo.dart';
import 'package:untitled/pages/Image/ImagePage.dart';
import 'package:untitled/pages/ListView/listView.dart';
import 'package:untitled/pages/ListView/list_scrollController.dart';
import 'package:untitled/pages/ListView/list_smartRefresher.dart';
import 'package:untitled/pages/Radio/radioDemo.dart';
import 'package:untitled/pages/RaisedButton_demo.dart';
import 'package:untitled/pages/Switch/switchDemo.dart';
import 'package:untitled/pages/animation/animationPage.dart';
import 'package:untitled/pages/appBar/appbar_page.dart';
import 'package:untitled/pages/button/button_demo.dart';
import 'package:untitled/pages/card_demo.dart';
import 'package:untitled/pages/choose_location.dart';
import 'package:untitled/pages/clip/clipDemo.dart';
import 'package:untitled/pages/container_demo.dart';
import 'package:untitled/pages/demo_list.dart';
import 'package:untitled/pages/dio_net/dio_get.dart';
import 'package:untitled/pages/error_page.dart';
import 'package:untitled/pages/gridView/gridViewDemo.dart';
import 'package:untitled/pages/home.dart';
import 'package:untitled/pages/itying/DialogDemo.dart';
import 'package:untitled/pages/itying/DioPage.dart';
import 'package:untitled/pages/itying/FormDemo.dart';
import 'package:untitled/pages/itying/MorePage.dart';
import 'package:untitled/pages/itying/SwiperDemo.dart';
import 'package:untitled/pages/layout/FlexibleDemo.dart';
import 'package:untitled/pages/layout/TabBarDemo.dart';
import 'package:untitled/pages/layout/WrapDemo.dart';
import 'package:untitled/pages/layout/columnPage.dart';
import 'package:untitled/pages/layout/columnRow.dart';
import 'package:untitled/pages/layout/rowPage.dart';
import 'package:untitled/pages/layout/stackPage.dart';
import 'package:untitled/pages/loading.dart';
import 'package:untitled/pages/login_widget/LoginWidget.dart';
import 'package:untitled/pages/my_navigator_observes.dart';
import 'package:untitled/pages/otherVeiw/BadgePage.dart';
import 'package:untitled/pages/otherVeiw/ListViewMonth.dart';
import 'package:untitled/pages/otherVeiw/MainFindPage.dart';
import 'package:untitled/pages/otherVeiw/StreamBuilderPage.dart';
import 'package:untitled/pages/otherVeiw/Toolitp_page.dart';
import 'package:untitled/pages/otherVeiw/WillPopScopePage.dart';
import 'package:untitled/pages/otherVeiw/imageShow.dart';
import 'package:untitled/pages/otherVeiw/listViewFag_page.dart';
import 'package:untitled/pages/otherVeiw/loadingPage.dart';
import 'package:untitled/pages/otherVeiw/phonePage.dart';
import 'package:untitled/pages/otherVeiw/physica_page.dart';
import 'package:untitled/pages/otherVeiw/progress_page.dart';
import 'package:untitled/pages/otherVeiw/segmented.dart';
import 'package:untitled/pages/otherVeiw/slidable_page.dart';
import 'package:untitled/pages/otherVeiw/slider_page.dart';
import 'package:untitled/pages/routes_demo.dart';
import 'package:untitled/pages/scaffold_demo.dart';
import 'package:untitled/pages/scendPage.dart';
import 'package:untitled/pages/sharedPreferences/sharedPreferencesDemo.dart';
import 'package:untitled/pages/stepper/stepper_one.dart';
import 'package:untitled/pages/tesxt/text_demo.dart';
import 'package:untitled/pages/textfeild/textfield_page.dart';
import 'package:untitled/pages/view/CustomScrollViewPage.dart';
import 'package:untitled/pages/view/CustomScrollViewPageII.dart';
import 'package:untitled/pages/view/NestedScrollViewDemo.dart';
import 'package:untitled/pages/view/SingleChildScrollViewDemo.dart';
import 'package:untitled/pages/view/NestedScrollViewWidget .dart';
import 'package:untitled/pages/view/Welcome.dart';
import 'package:untitled/pages/view/first_guid_page.dart';
import 'package:untitled/pages/view/home/login_page.dart';
import 'package:untitled/pages/view/home_page.dart';
import 'package:get/get.dart';
import 'package:untitled/pages/yinghang.dart';

//配置路由
final Map<String,Function> routes = {
      "/":(context) => DemoList(),
      "/loading":(context) => Loading(),
      "/home":(context) => Home(),
      "/location":(context) => ChooseLocation(),
      "/firstPage":(context) => RouterDemo(),
      "/scend":(BuildContext context) => ScendPage(),
      "/appbar":(BuildContext context) => AppBarHomePage(),
      "/scaffold":(BuildContext context) => ScffoldHomePage(),
      "/text":(BuildContext context) => TextHomePage(),
      "/button":(BuildContext context) => ButtonDemo(),
      "/textfield":(BuildContext context) => TextFieldPage(),
      "/raisedButton":(BuildContext context) => RaisedButtonDemo(),
      "/card":(BuildContext context) => CardDemo(),
      "/Container":(BuildContext context) => ContainerDemo(), 
      "/cupertino":(BuildContext context) => CurperDemo(), // Column
      "/column":(BuildContext context) => ColumnDemo(), 
      "/row":(BuildContext context) => RowDemo(), 
      "/Columnrow":(BuildContext context) => RowColunmDemo(), 
      "/stack":(BuildContext context) => StactPage(),
      "/image":(BuildContext context) => ImagePage(),
      "/checkbox":(context) => CheckboxDemo(),
      "/radio":(context) => RadioDemo(),
      "/gesture":(context) => GestureDetectorDemo(),
      "/switch":(context) => SwitchDemo(),
      "/singView":(context) => SingleChildScrollViewDemo(),
      "/nestView":(context) => NestedScrollViewDemo(),
      "/nestView2":(context) => NestedScrollViewPage(),
      "/custom":(context) => CustomScrollViewPage(),
      "/custom2":(context) => CustomScrollViewPageII(),
      "/listView":(context) => ListViewDemo(),
      "/listView2":(context) => ListViewDemoII(),
      "/listView3":(context) => ListViewDemoIII(),
      "/gridView":(context) => GridViewPage(),
      "/clip":(context) => ClipDemo(),
      "/animation":(context) => AnimationPage(),
      "/progress":(context) => ProgressPage(),
      "/slider":(context) => SliderPage(),
      "/cuper":(context) => CuoertinoSegmentedControl(),
      "/tooltip":(context) => ToolipPage(),
      "/physica":(context) => PhysicalModelPage(),
      "/slidable":(context) => SlidablePage(),
      "/listviewFag":(context) => ListViewFagPage(),
      "/dateTime":(context) => DataTimeRangerDemo(),
      "/phone":(context) => PhonePage(),
      "/will":(context) => MyWidget(),
      "/stream":(context) => StreamBuiderPage(),
      "/loadingI":(context) => LoadingPage(),
      "/badge":(context) => BadgePage(),
      "/imageshow":(context) => ImageShow(),
      "/main":(context) => DouPage(),
      "/dioGet":(context) => Dioget(),
      "/share":(context) => ShareDemo(),
      "/welcome":(context) => WelComePage(),
      "/homePage":(context) => HomePage(),
      "/guild":(context) => FirstGuidPage(),
      "/loginPage":(context) => LoginDemo(),
      "/getR":(context) => GetxDemo(),
      "/testa":(context) => TestAPage(),
      "/getX":(context) => CountMainPage(),
      "/getRx":(context) => CountObsMainPage(),
      "/getD":(context) => WorkesMainPage(),
      "/getS":(context) => ShopMainPage(),
      "/fromI":(context) => FormDemoPage(),
      "/swiper":(context) => SwiperDemo(),
      "/dialog":(context) => DialogDemo(),
      "/dioDemo":(context) => DioDemo(),
      "/moreDemo":(context) => MorePage(),
      "/wrapDemo":(context) => WrapDemo(),
      "/rowDemo":(context) => FlexibleDemo(),
      "/tabDemo":(context) => TabBarDemo(),
      "/YHDemo":(context) => YHdemo(),
      "/login":(context) => LoginWidget(),
      "/fromWidget":(context) => FormWidget(),
      "/stepper":(context) => StepperDemoState(),
      "/yiqing":(context) => Yiqing(),
      "/travel":(context) => TravelHome(),
      "/shopping":(context) => Shopping(),
      "/shoe":(context)=> ShoeMain(),
      
};

//固定写法
var onGenerateRoute = (RouteSettings settings) {
  final String? name = settings.name;
  final Function? pageContentBuilder = routes[name];
  if (pageContentBuilder != null) {
    if (settings.arguments != null) {
      final Route route = MaterialPageRoute(
          builder: (context) =>
              pageContentBuilder(context, arguments: settings.arguments));
      return route;
    } else {
      final Route route =
      MaterialPageRoute(builder: (context) => pageContentBuilder(context));
      return route;
    }
  }
};